import { defineStore } from "pinia"
import { ref } from "vue"

// Obtain the current window size
export const useWindowsWidthStore = defineStore("windowsWidth", ()=>{
  const windowsWidth = ref(window.innerWidth)
  const handleResize = () => {
    windowsWidth.value = window.innerWidth
  }
  window.addEventListener("resize", handleResize)
  return { windowsWidth }
})
